import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ProjectVO, ProjectForm, ProjectQuery } from './types';

/**
 * 获取项目列表
 * @param query
 * @returns {*}
 */

export const listProject = (query?: ProjectQuery): AxiosPromise<ProjectVO[]> => {
  return request({
    url: '/oce/third/getProjectList',
    method: 'get',
    params: query
  });
};

/**
 * 新增橙子建站落地页
 * @param data
 */
export const addProject = (data: ProjectVO) => {
  return request({
    url: '/oce/third/createProject',
    method: 'post',
    data: data
  });
};

/**
 * 修改橙子建站落地页
 * @param data
 */
export const updateProject = (data: ProjectVO) => {
  return request({
    url: '/oce/third/updateProject',
    method: 'post',
    data: data
  });
};

/**
 * 删除橙子建站落地页
 * @param projectIds
 */
export const delProject = (projectIds: string | number | Array<string | number>) => {
  return request({
    url: '/oce/third/deleteProject/' + projectIds,
    method: 'delete'
  });
};
